
package rendi456.structure.grid;

public class GridAddress
{
	protected int row = 0;
	protected int column = 0;

	public GridAddress()
	{
		this(0, 0);
	}

	public GridAddress(GridAddress gridAddress)
	{
		this(gridAddress.getRow(), gridAddress.getColumn());
	}

	public GridAddress(int row, int column)
	{
		this.setRow(row);
		this.setColumn(column);
	}

	public int getRow()
	{
		return this.row;
	}

	public int getColumn()
	{
		return this.column;
	}

	public void setRow(int row)
	{
		this.row = row;
	}

	public void setColumn(int column)
	{
		this.column = column;
	}

	@Override
	public boolean equals(Object gridAddress)
	{
		boolean out = (gridAddress != null)
				&& gridAddress instanceof GridAddress;

		if (out)
		{
			GridAddress ga = (GridAddress) gridAddress;
			out = (this.getRow() == ga.getRow())
					&& (this.getColumn() == ga.getColumn());
		}
		return out;
	}

	@Override
	public String toString()
	{
		return "[" + this.row + ", " + this.column + "]";
	}

}
